import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;


public class aa {

	
	 public static String encrypt(String content) {

		 String  vector = "0000000000000000"; 
		 String   keyString = "1234567890123456";
		    
		    
		
		    String data = null;

		    try {
			    IvParameterSpec ips = new IvParameterSpec(vector.getBytes("utf-8"));

			    SecretKeySpec key = new SecretKeySpec(keyString.getBytes("utf-8"), "AES");

			    Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); 

			    cipher.init(Cipher.ENCRYPT_MODE, key, ips);
//			    cipher.init(Cipher.ENCRYPT_MODE, key);

			    byte[] encryptedData = cipher.doFinal(content.getBytes());

//			    data = new BASE64Encoder().encode(encryptedData);
			    data = new String(encryptedData);

		    } catch (Exception e) {
			    e.printStackTrace();
		    }

		    return data;
		}
	 
	 
	 public static void main(String[] args) {
		
		    String content = "aaaaaaaaaaaaaaaaaaa";
		    String encryptResult = encrypt(content);
		    System.out.println(encryptResult);
		    
		    
		 
	}
}
